<%--
  Created by IntelliJ IDEA.
  User: jshand
  Date: 2022-10-21
  Time: 10:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h3>设置Cookie的</h3>

<%
    Cookie cookie = new Cookie("idno","0000002");
    cookie.setMaxAge(10);  //最大存活时间  秒    默认值 -1 ： 会话有效  ， 设置为0 删除Cookie
    cookie.setDomain("127.0.0.1");
    cookie.setPath(request.getContextPath());
    response.addCookie(cookie);

%>


</body>
</html>
